package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appmarket.service.store.awk.card.ContentMidCard;
import com.huawei.appmarket.service.store.awk.card.ContentMidItemCard;
import com.huawei.appmarket.service.store.awk.card.TitleExtCard;
import o.azb;
import o.cdr;
import o.cgz;
import o.chy;
import o.cih;
import o.Logger;
import o.eib;
import o.eir;
import o.epv;
import o.ewm.h;

public class ContentMidNode extends cdr {
    public ContentMidNode(Context context) {
        super(context, 0);
    }

    public int ˏ() {
        return eib.ʻॱ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        cih contentMidCard = new ContentMidCard(this.ॱ);
        View view = (LinearLayout) from.inflate(h.ॱʿ, null);
        contentMidCard.ˏ(view);
        TitleExtCard titleExtCard = new TitleExtCard(this.ॱ);
        View inflate = from.inflate(h.ॱˈ, null);
        azb.ˏ(inflate);
        titleExtCard.ˏ(inflate);
        contentMidCard.ˊ(titleExtCard);
        view.addView(inflate);
        LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
        LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -2);
        int ʽॱ = eib.ʽॱ();
        int ʿ = eib.ʿ();
        for (int i = 0; i < ʽॱ; i++) {
            View linearLayout = new LinearLayout(this.ॱ);
            if (epv.ˏॱ(this.ॱ)) {
                linearLayout.setOrientation(0);
                layoutParams3.weight = 1.0f;
            } else {
                linearLayout.setOrientation(1);
            }
            linearLayout.setLayoutParams(layoutParams2);
            for (int i2 = 0; i2 < ʿ; i2++) {
                View view2 = (ViewGroup) from.inflate(h.ॱʾ, null);
                view2.setLayoutParams(layoutParams3);
                cgz contentMidItemCard = new ContentMidItemCard(this.ॱ);
                contentMidItemCard.ˏ(view2);
                contentMidCard.ॱ(contentMidItemCard);
                linearLayout.addView(view2);
            }
            view.addView(linearLayout);
        }
        ˊ(contentMidCard);
        viewGroup.addView(view, layoutParams);
        return true;
    }

    public void ˋ(chy o_chy) {
        for (int i = 0; i < ˊॱ(); i++) {
            ContentMidCard contentMidCard = (ContentMidCard) ˊ(i);
            if (contentMidCard != null) {
                contentMidCard.ˋ().ॱ(o_chy);
                for (int i2 = 0; i2 < contentMidCard.ˎ(); i2++) {
                    cgz ˋ = contentMidCard.ˋ(i2);
                    View view = null;
                    if (ˋ != null) {
                        view = ˋ.ˉ();
                    }
                    if (view != null) {
                        if (Logger.ˎ()) {
                            Logger.ˏ("ContentMidNode", "setOnClickListener");
                        }
                        view.setOnClickListener(new eir(o_chy, ˋ, 0));
                    }
                }
            }
        }
    }
}
